home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / AppleScript / QUICKTIME 5.0.2 SCRIPTS / Script Templates / QT 5 Movie Template < prev    next >
Encoding:
Text File  |  2001-06-26  |  1.7 KB  |  57 lines

  1. tell application "QuickTime Player"
  2.     activate
  3.     
  4.     try
  5.         if not (exists movie 1) then error "No movies are open."
  6.         
  7.         stop every movie
  8.         
  9.         -- CHECK FOR THE CORRECT VERSION OF QUICKTIME
  10.         set the QT_version to (the QuickTime version as string)
  11.         set the player_version to (the version as string)
  12.         set the required_version to "5.0.2"
  13.         if (the QT_version is less than the required_version) or ¬
  14.             (the player_version is less than the required_version) then
  15.             set the error_message to "This script requires QuickTime " & the required_version & "  or greater." & ¬
  16.                 return & return & ¬
  17.                 "Current QuickTime Version: " & QT_version & return & ¬
  18.                 "Current QuickTime Player Version: " & player_version
  19.             my upgrade_QT(error_message)
  20.         end if
  21.         
  22.         -- CHECK FOR QUICKTIME PRO
  23.         if QuickTime Pro installed is false then
  24.             set the error_message to "This script requires a QuickTime Pro installation on this system."
  25.             my upgrade_QT(error_message)
  26.         end if
  27.         
  28.         tell movie 1
  29.             
  30.             -- SCRIPT STATEMENTS GO HERE
  31.             
  32.         end tell
  33.     on error error_message number error_number
  34.         if the error_number is not -128 then
  35.             beep
  36.             display dialog error_message buttons {"Cancel"} default button 1
  37.         end if
  38.     end try
  39. end tell
  40.  
  41. on upgrade_QT(passed_message)
  42.     tell application "QuickTime Player"
  43.         activate
  44.         stop every movie
  45.         set the target_URL to "http://www.apple.com/quicktime/download/"
  46.         display dialog passed_message & return & return & ¬
  47.             "If this computer is currently connected to the Internet, " & ¬
  48.             "click the “Upgrade” button to visit the QuickTime Website." buttons {"Upgrade", "Cancel"} default button 2
  49.         ignoring application responses
  50.             tell application "Finder"
  51.                 open location target_URL
  52.             end tell
  53.         end ignoring
  54.         error number -128
  55.     end tell
  56. end upgrade_QT
  57.